package optimzations

import "fmt"

func combine1(vec [][]int) int {
	rs := 0
	for i := 0; i < len(vec); i++ {
		colLength := len(vec[i])
		for j := 0; j < colLength; j++ {
			rs += vec[j][i]
		}
	}
	return rs
}

func combine2(vec [][]int) int {
	rs := 0
	row, col := len(vec), len(vec[0])
	for i := 0; i < row; i++ {
		for j := 0; j < col; j++ {
			rs += vec[i][j]
		}
	}
	return rs
}

func combine3(vec []int) int {
	rs := 0
	for i := 0; i < len(vec); i++ {
		rs += vec[i]
	}
	fmt.Println(rs)
	return rs
}

func combine4(vec []int) int {
	rs := 0
	l := len(vec)
	for i := 0; i < l; i++ {
		rs += vec[i]
	}
	fmt.Println(rs)
	return rs
}
